<template>
  <div class="father">
    <h2>父组件</h2>
    <div class="category-container">
      <Game >
        <template v-slot="params">
          <ul>
            <li v-for="game in params.games" :key="game.id">{{ game.name }}</li>
          </ul>
        </template>
      </Game>
      <Game >
        <!-- 解构赋值 -->
        <template v-slot="{games}">
          <ol>
            <li v-for="game in games" :key="game.id">{{ game.name }}</li>
          </ol>
        </template>
      </Game>
      <Game >
        <template v-slot:footer="params">
          <h3>{{ params.a }}</h3>
        </template>
      </Game>
    </div>
  </div>
</template>

<script setup lang="ts">
import Game from './Game.vue'

</script>

<style scoped>
.father {
  padding: 20px;
  background-color: rgb(165, 164, 164);
  border-radius: 10px;
}

.category-container {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
</style>